﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;

namespace SoftHelper.Tool
{
    /// <summary>
    /// 左侧文件列表根据文件扩展名转换成文件图标
    /// </summary>
    public class FileTypeIconConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            switch (value.ToString().ToLower())
            {
                case "java":
                    return "\xe66a";
                case "html":
                    return "\xecb7";
                case "css":
                    return "\xe61e";
                case "php":
                    return "\xe67e";
                case "cs":
                    return "\xe8f8";
                case "js":
                    return "\xe704";
                case "jpg":
                    return "\xec17";
                case "png":
                    return "\xec18";
                case "xaml":
                    return "\xe942";
                case "xml":
                    return "\xe610";
                case "py":
                    return "\xe891";
                case "gradle":
                    return "\xe62d";
                case "md":
                    return "\xe7a1";
                case "samples":
                    return "\xe633";
                case "json":
                    return "\xe613";
                case "ico":
                    return "\xe618";
                case "csproj":
                    return "\xe61f";
                case "class":
                    return "\xe617";
                case "c":
                    return "\xeb85";
                default:
                    return "\xe600";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
